package cate.game.role.farm.island.cell;

import cate.common.table.d.GDIsland;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

import java.util.List;

@NoteClass(value = "增益格子")
public class GainCell extends IslandCell {

    public GainCell() {
        this.type = GDIsland.CellType.GAIN;
    }

    @NoteField(value = "守卫id")
    public int guardTid;

    @NoteField(value = "增益id")
    public List<Integer> gains;

    public GainCell setGains(List<Integer> gains) {
        this.gains = gains;
        return this;
    }

    public Integer getGainByIndex(int index) {
        if (gains.size() > index && index >= 0) {
            return gains.get(index);
        }
        return null;
    }

    @Override
    public String toString() {
        return super.toString() + "增益格子";
    }
}
